<template>
  <li :class="{'active': isActive}" @click="handleItemClick">
    <slot></slot>
  </li>
</template>

<script>
  export default {
    name: "singleSelectItem",
    computed: {
      isActive() {
        return this.value === this.$parent.value
      }
    },
    props: {
      value: [String, Number]
    },
    methods: {
      handleItemClick() {
        this.$parent.$emit('input', this.value);
      }
    }
  }
</script>

<style scoped lang="scss">
</style>
